<%--
  Created by IntelliJ IDEA.
  User: MySunshine
  Date: 2022/10/28
  Time: 14:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>书籍添加</title>
    <link rel="stylesheet" href="../../layui/css/layui.css">
    <style>
        body{
            color: rgba(153, 149, 149, 0.94);
            font-size: 20px;
            margin: 0;
            padding: 0;
            text-align: center;
            background: linear-gradient(#25517f, #17649d);
            background-size: 100%;
        }
        .ma{
            position: absolute;
            right: 60px;
        }
    </style>
</head>
<body>
<div class="layui-row layui-col-md4 layui-col-md-offset4 " >
    <form class="layui-form" action="/BookAdd" enctype="multipart/form-data" method="post">
        <h1 style="padding: 50px">书籍添加</h1>
        <div class="layui-form-item">
            <label class="layui-form-label">书名</label>
            <div class="layui-input-block">
                <input type="text" name="book" required  lay-verify="required" placeholder="请输入书名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">作者</label>
            <div class="layui-input-block">
                <input type="text" name="user" required lay-verify="required" placeholder="请输入作者" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">书籍类型</label>
            <div class="layui-input-block">
                <select  name="kid" lay-verify="required" >
                    <option>请选择类型</option>
                    <c:forEach var="k" items="${kinds}" >
                        <option  value="${k.kid}">${k.kind}</option>
                    </c:forEach>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">简介</label>
            <div class="layui-input-block">
                <textarea name='synopsis'   class='layui-textarea'></textarea>
            </div>
        </div>
        <div class="layui-form-item">
        <div class="p">
            <label class="layui-form-label">书籍封面</label>
            <input type="file" name="img" >  <br> <br>
        </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">资源地址</label>
            <div class="layui-input-block">
                <input type="text" name="url"  required   lay-verify="required" placeholder="输入资源地址" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="formDemo">提 交</button>
                <button type="reset" class="layui-btn layui-btn-danger">重 置 </button>
            </div>
        </div>
    </form>
</div>
</body>
<script src="../../layui/layui.js"></script>
<script>
    //Demo
    layui.use('form','jquery','layer',function(){
        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
</script>
</html>